package edu.gdkm.demo12;

import java.util.Iterator;
import java.util.List;

public class ListTest3 {
    public static void main(String[] args) {
        StudentManager studentManager=new StudentManager();
        studentManager.init();
        List<Student> studentList= studentManager.studentList;
//        //增强for循环进行遍历
//        for(Student student:studentList){
//            System.out.println(student);
//        }
        //迭代器遍历集合。
        Iterator<Student> iterator=studentList.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next().getStudentName());
        }
    }
}
